package cn.wolfcode.rbac.request;

import cn.wolfcode.rbac.config.QueryObject;
import com.alibaba.druid.util.StringUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author Lu.F
 * @version 1.0
 * @Description TODO
 * @date 2022/5/19 15:14
 */
@ApiModel("对象请求体")
public class EmployeeQueryRequest extends QueryObject {


    @ApiModelProperty(value = "姓名/邮箱",example = "部门")
    private String keyword;		//关键字搜索

    @ApiModelProperty(value = "部门id，默认为-1,即查询全部.前端页面已定义",example = "-1")
    private Long deptId = -1L;	//下拉框部门显示(默认为-1,即查询全部.前端页面已定义)

    //判空操作写在java类中,而不是写在mapper.xml文件中
    public String getKeyword(){
        //调用工具类判断用户输入的关键字是否为空
        return StringUtils.isEmpty(keyword) ? null : keyword;
    }

    public void setKeyword(String keyword){
        this.keyword = keyword;
    }

    public Long getDeptId(){
        return this.deptId;
    }

    public void setDeptId(Long deptId){
        this.deptId = deptId;
    }



}
